 package com.cxl.pattern.iterator;
 
 public class BookShelf
   implements Aggregate
 {
   private Book[] books;
   private int last = 0;
 
   public BookShelf(int maxSize) {
     this.books = new Book[maxSize];
   }
 
   public Book getBookAt(int index) {
     return this.books[index];
   }
 
   public void appendBook(Book book)
   {
     this.books[this.last] = book;
     this.last += 1;
   }
 
   public int getLength()
   {
     return this.books.length;
   }
 
   public Iterator iterator()
   {
     return new BookShelfIterator(this);
   }
 }

/* Location:           E:\work\eclipse3.6_\workspace\design_pattern\
 * Qualified Name:     com.cxl.pattern.iterator.BookShelf
 * JD-Core Version:    0.6.1
 */